package my.soft.aiteacher.student.controller;


import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import my.soft.aiteacher.student.pojo.StarRatings;
import my.soft.aiteacher.student.service.IStarRatingsService;
import my.soft.aiteacher.utils.R;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 基础五星评分表 前端控制器
 * </p>
 *
 * @author GMCX
 * @since 2025-06-09
 */
@RestController
@Tag(name = "学生-评分管理", description = "学生-评分管理")
@RequestMapping("/starRatings")
public class StarRatingsController {
    @Resource
    private IStarRatingsService starRatingsService;
    @PreAuthorize("hasAnyAuthority('upload:starRatings:student')")
    @RequestMapping(value = "/upload", method = {RequestMethod.POST})
    @Operation(summary = "上传评分信息")
    public R upload(@RequestBody StarRatings starRatings){
        starRatingsService.upload(starRatings);
        return R.success("ok");
    }

}
